package com.yonyou.train.yonyouec;

import com.google.gson.Gson;
import com.yonyou.train.service.CoursePreviewService;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class MsgNotice {
    static String baseUrl="https://openapi.yonyoucloud.com/rest/message/app/txt?access_token=";
    static String appid = "bfbfdd1018ed288e";
    static String secret = "8421fbe35fc36e794e2d7e68ce67dc674372d05fbd7476de72f7748fb0b3";

    public void getMsg(ArrayList<String> list,String applicant_name,String class_name){
        SyncEcUser ecUser=SyncEcUser.getInstance();
        Map<String,Object> map=new HashMap();
        map.put("spaceId", "spaceId01");
        map.put("appId","app01");
        map.put( "sendThrough","appAccount");
        map.put("sendScope","list");
        map.put("to",list);
        map.put("content",applicant_name+"给你报名了"+class_name+"课程");
        ecUser.doGetToken();
        String url=baseUrl+ecUser.getToken();
        Gson gson=new Gson();
        String json=gson.toJson(map);

        RequestUtil.postBody(url,json);
    }




}
